package com.itheima.d2_collections;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class CollectionsTest1 {
    public static void main(String[] args) {
        List<String > names =new ArrayList<>();
        Collections.addAll(names,"zhansgan","wangwu","erliu");//为集合添加元素
        System.out.println(names);

        Collections.shuffle(names);//为集合乱序
        System.out.println(names);

        List<Integer> list =new ArrayList<>();
        list.add(3);
        list.add(8);
        list.add(1);
        Collections.sort(list);//升序排序
        System.out.println(list);

    }
}
